package com.tkc.common.result;

import java.util.ArrayList;
import java.util.List;

import com.tkc.common.enums.BaseResultCodeEnum;
import com.tkc.common.result.info.PageInfo;

/**
 * 
 * @Function: 分页查询结果对象
 * 
 * @Project :assessmenttask 
 * @Package :com.tkc.common.result 
 * @File :PageListResult.java 
 * @ClassName: PageListResult  
 * 
 * @author tankaichao 
 * @email cgztkc@126.com 
 * @Date 2016年8月9日下午7:01:29
 * @since JDK 1.8 
 *
 */
public class PageListResult<T> extends CommonResult {

    /** serialVersionUID */
    private static final long serialVersionUID = 1381387813917430279L;

    /** 数据列表 */
    private List<T>           dataList         = new ArrayList<T>();

    /**分页信息*/
    private PageInfo          pageInfo;

    /**
     * 默认构造函数
     * 
     */
    public PageListResult() {
    }

    /**
     * 构造函数
     * 
     * @param resultCodeEnum 结果编码
     */
    public PageListResult(BaseResultCodeEnum baseResultCodeEnum, List<T> dataList, PageInfo pageInfo) {
        setSuccess(baseResultCodeEnum == BaseResultCodeEnum.ERR_CODE_200);
        setResultCode(baseResultCodeEnum.getCode());
        setResultMsg(baseResultCodeEnum.getMsg());
        setDataList(dataList);
        setPageInfo(pageInfo);
    }

    /**
     * Getter method for property <tt>dataList</tt>.
     * 
     * @return property value of dataList
     */
    public List<T> getDataList() {
        return dataList;
    }

    /**
     * Setter method for property <tt>dataList</tt>.
     * 
     * @param dataList value to be assigned to property dataList
     */
    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    /**
     * Getter method for property <tt>pageInfo</tt>.
     * 
     * @return property value of pageInfo
     */
    public PageInfo getPageInfo() {
        return pageInfo;
    }

    /**
     * Setter method for property <tt>pageInfo</tt>.
     * 
     * @param pageInfo value to be assigned to property pageInfo
     */
    public void setPageInfo(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }

}
